package com.kpmg.questionnaire.model;

import javax.persistence.*;
import java.sql.Date;

/**
 * Created by xionghao on 2016/11/12.
 */
@Entity
@Table(name = "answer", schema = "questionnaire", catalog = "")
public class AnswerEntity {
    private int id;
    private String content;
    private String question;
    private String type;
    private String userId;
    private String results;
    private String sectionOneResult;
    private String sectionTwoResult;
    private String sectionThreeResult;
    private String title;
    private Date createDate;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "content", nullable = false, length = 255)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "question", nullable = false, length = 255)
    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    @Basic
    @Column(name = "type", nullable = false, length = 100)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "userId", nullable = false, length = 100)
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "results", nullable = false, length = 100)
    public String getResults() {
        return results;
    }

    public void setResults(String results) {
        this.results = results;
    }

    @Basic
    @Column(name = "sectiononeresult", nullable = false, length = 100)
    public String getSectionOneResult() {
		return sectionOneResult;
	}

	public void setSectionOneResult(String sectionOneResult) {
		this.sectionOneResult = sectionOneResult;
	}

    @Basic
    @Column(name = "sectiontworesult", nullable = false, length = 100)
	public String getSectionTwoResult() {
		return sectionTwoResult;
	}

	public void setSectionTwoResult(String sectionTwoResult) {
		this.sectionTwoResult = sectionTwoResult;
	}

    @Basic
    @Column(name = "sectionthreeresult", nullable = false, length = 100)
	public String getSectionThreeResult() {
		return sectionThreeResult;
	}

	public void setSectionThreeResult(String sectionThreeResult) {
		this.sectionThreeResult = sectionThreeResult;
	}

	@Basic
    @Column(name = "title", nullable = true, length = 100)
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AnswerEntity that = (AnswerEntity) o;

        if (id != that.id) return false;
        if (content != null ? !content.equals(that.content) : that.content != null) return false;
        if (question != null ? !question.equals(that.question) : that.question != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (results != null ? !results.equals(that.results) : that.results != null) return false;
        if (title != null ? !title.equals(that.title) : that.title != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (question != null ? question.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (results != null ? results.hashCode() : 0);
        result = 31 * result + (title != null ? title.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "createDate", nullable = false)
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
}
